home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / tf.doc < prev    next >
Text File  |  1995-03-31  |  3KB  |  68 lines

  1. (Comp.sys.handhelds) 
  2. Item: 2552 by cloos at acsu.buffalo.edu 
  3. Author: [James H. Cloos] 
  4.   Subj: (HP48SX) TF, a toggle flag program 
  5.   Date: Fri Mar 29 1991 
  6.  
  7. Hello, 
  8.  
  9. Please find eclosed a usrlang and a rpl version of TF, a program that 
  10. toggles a flag.  The syntax is the same as for SF and CF.  (There may 
  11. actually be a routine in ROM that does this, but I haven't found one yet.) 
  12.  
  13. First, the usrlang version in ASCII mode: 
  14.  
  15. --------------------------------------------------START_HERE- 
  16. %%HP: T(3)A(R)F(.); 
  17. \<< DUP FS?C \<< DROP \>> \<< SF \>> IFTE \>> 
  18. ---------------------------------------------------END_HERE-- 
  19.  
  20. Here is the RPLC version of the rpl version, using a minimal symbol table: 
  21.  
  22. --------------------------------------------------START_HERE- 
  23. /* tf.rplc  - by James H. Cloos, Jr. */ 
  24. /* USE AT YOUR OWN RISK */ 
  25. /* Note that RPLC format is free form wrt whitespace, just like C. */ 
  26. // Also note that comments are as per C++. 
  27.  
  28. :: ==18ECEh 
  29.     #1  :: ==3188h ==1C4BFh ==61AD8h ==3244h ==1C28Dh ; 
  30. ---------------------------------------------------END_HERE-- 
  31.  
  32. (The logic is basically the same; FS?C is used in preference to FC?C as 
  33. FC?C at this level is basically a :: fs?c not ;.) 
  34.  
  35. The list file from star, cut to the essential section (ie, p2) is: 
  36.  
  37. STAR 1.04.4     Thu Mar 28 20:37:59 1991                        tf.star - 2 
  38.  
  39.   1   70010                      
  40.   2   70010                     ;;      RPLC version A.1.3 
  41.   3   70010                      
  42.   4   70010  d9d20                      data.a  type_col 
  43.   5   70015  ece81                      data.a  x'18ece         ;; Switch1 
  44.   6   7001a  9ff30                      data.a  x'3ff9          ;; #1 
  45.   7   7001f  d9d20                      data.a  type_col 
  46.   8   70024  88130                      data.a  x'3188          ;; dup 
  47.   9   70029  fb4c1                      data.a  x'1c4bf         ;; 
  48. fs?c_1real 
  49.  10   7002e  8da16                      data.a  x'61ad8         ;; *see 
  50. below* 
  51.  11   70033  44230                      data.a  x'3244          ;; drop 
  52.  12   70038  d82c1                      data.a  x'1c28d         ;; sf_1real 
  53.  13   7003d  b2130                      data.a  semi 
  54.  14   70042  b2130                      data.a  semi 
  55.  15   70047                      
  56.  
  57. (The names Switch1 thru sf_real added by hand.) 
  58. Derek calls 61ad8: "if pop TOS = True, then do/skip else skip/do" 
  59.  
  60. As written, if a too_few_args or _bad_arg_type error is generated, you'll 
  61. get the message "XLIB lll ccc Error:."  I left this this way as it will 
  62. eventually be part of a lib I'll be posting.  When included in a lib, 
  63. errors will show up as "TF Error:" instead.  (BTW, a quick calculation 
  64. suggests that the XLIB number in the above error message would be 
  65. "XLIB 1620 36" for the name 'TF' (it is a consequence of how lib's and 
  66. dir's are stored internally; see my previous posting on the subject).) 
  67.